cost=[]
with open('2.txt','r') as file:
    for row in file.readlines():
        ls=row.split(' ')
        cost.append(int(ls[1]) * int(ls[2]))
print(sum(cost))